package com.shuma.product.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 
 * @TableName sales_or_exchange
 */
@TableName(value ="sales_or_exchange")
@Data
public class SalesOrExchange implements Serializable {
    /**
     * 
     */
    @TableId
    private Long productsId;

    /**
     * 
     */
    private Integer exchangeCount;

    /**
     * 
     */
    private LocalDateTime onTime;

    /**
     * 
     */
    private LocalDateTime offTime;

    /**
     * 
     */
    private Integer integralCount;

    /**
     * 
     */
    private Integer integralCashCount;

    /**
     * 
     */
    private Integer cashCount;

    /**
     * 
     */
    private Integer sales;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SalesOrExchange other = (SalesOrExchange) that;
        return (this.getProductsId() == null ? other.getProductsId() == null : this.getProductsId().equals(other.getProductsId()))
            && (this.getExchangeCount() == null ? other.getExchangeCount() == null : this.getExchangeCount().equals(other.getExchangeCount()))
            && (this.getOnTime() == null ? other.getOnTime() == null : this.getOnTime().equals(other.getOnTime()))
            && (this.getOffTime() == null ? other.getOffTime() == null : this.getOffTime().equals(other.getOffTime()))
            && (this.getIntegralCount() == null ? other.getIntegralCount() == null : this.getIntegralCount().equals(other.getIntegralCount()))
            && (this.getIntegralCashCount() == null ? other.getIntegralCashCount() == null : this.getIntegralCashCount().equals(other.getIntegralCashCount()))
            && (this.getCashCount() == null ? other.getCashCount() == null : this.getCashCount().equals(other.getCashCount()))
            && (this.getSales() == null ? other.getSales() == null : this.getSales().equals(other.getSales()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getProductsId() == null) ? 0 : getProductsId().hashCode());
        result = prime * result + ((getExchangeCount() == null) ? 0 : getExchangeCount().hashCode());
        result = prime * result + ((getOnTime() == null) ? 0 : getOnTime().hashCode());
        result = prime * result + ((getOffTime() == null) ? 0 : getOffTime().hashCode());
        result = prime * result + ((getIntegralCount() == null) ? 0 : getIntegralCount().hashCode());
        result = prime * result + ((getIntegralCashCount() == null) ? 0 : getIntegralCashCount().hashCode());
        result = prime * result + ((getCashCount() == null) ? 0 : getCashCount().hashCode());
        result = prime * result + ((getSales() == null) ? 0 : getSales().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", productsId=").append(productsId);
        sb.append(", exchangeCount=").append(exchangeCount);
        sb.append(", onTime=").append(onTime);
        sb.append(", offTime=").append(offTime);
        sb.append(", integralCount=").append(integralCount);
        sb.append(", integralCashCount=").append(integralCashCount);
        sb.append(", cashCount=").append(cashCount);
        sb.append(", sales=").append(sales);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}